# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=rsibreak
pkgver=0.12.15
pkgrel=0
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by polkit -> kxmlgui
arch="all !armhf !s390x !riscv64"
url="https://apps.kde.org/rsibreak/"
pkgdesc="Takes care of your health and regularly breaks your work to avoid repetitive strain injury (RSI)"
license="GPL-2.0-or-later"
depends="frameworkintegration"
makedepends="
	extra-cmake-modules
	kconfig-dev
	kconfigwidgets-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	ki18n-dev
	kidletime-dev
	knotifications-dev
	knotifyconfig-dev
	ktextwidgets-dev
	kwindowsystem-dev
	kxmlgui-dev
	qt5-qtbase-dev
	samurai
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/rsibreak/${pkgver%.*}/rsibreak-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
8178387716b9d611a33ce72070bae1c3d55ad098100a701fcae9f40a8db4bb29eda364a799223a6fea5671e44e0a5a41aa2b6dff2fb50a832221e468c17de87b  rsibreak-0.12.15.tar.xz
"
